import { UnsafeClient } from "./utils/content-unsafe";

UnsafeClient.init()

export function backupAuth(hash: string) {
    window.opener?.postMessage({ type: 'backupAuth', hash }, '*')
}

export function installScript(url: string) {
    window.postMessage({ type: 'installDogScript', data: encodeURIComponent(url) }, '*')
}

Reflect.set(window, 'dog', {
    backupAuth,
    installScript,
});